Duplicate Events fix - Add request ID and creation timestamp #1436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference
SDK-2493 - Add unique id and timestamp to iOS SDK events
https://branch.atlassian.net/browse/SDK-2493
Summary
--
branch_sdk_request_creation_time_stamp
- Timestamp when the request object was created.--
branch_sdk_request_uuid
- unique identifier for request. It includes a UUID + Date in GMT locale. Date part is appended to match the format Gateway uses.Format : UUID + YYYYMMDDHH
Sample:
"branch_sdk_request_creation_time_stamp" : 1727927969748, "branch_sdk_request_uuid" : "40991413-1CF5-4B23-90B6-698204582872-2024100303",
Motivation
These fields will help in debugging and in uniquely identifying requests generated from SDK.
Type Of Change
Testing Instructions
Verify all unit tests pass.
Send Following Requests using SDK -
* INSTALL / OPEN ( v1/open , v1/install )
* STANDARD / CUSTOM EVENTS ( v2/event )
* GENERATE SHORL URL (v1/url)
Verify All Requests body contain following params -
branch_sdk_request_creation_time_stamp
branch_sdk_request_uuid
Verify
branch_sdk_request_uuid
is unique for all requests.* QR Code( v1/qr-code)
* Share Sheet (v1/url)
Verify Caching -
* Before Sending an event, turn off WIFI (internet).
* Note down
branch_sdk_request_uuid
andbranch_sdk_request_creation_time_stamp
of the request* Quit App, tune on WIFI cold-launch it again.
* App will re-send request which was failed in previous launch. Verify request has same
branch_sdk_request_uuid
andbranch_sdk_request_creation_time_stamp
Verify
branch_sdk_request_uuid
andbranch_sdk_request_creation_time_stamp
are persisted for all request types (Unit Tests -testUUIDANDTimeStampPersistence
)cc @BranchMetrics/saas-sdk-devs for visibility.